import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
const app = createApp(App)

//pinia
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia()
app.use(pinia)
pinia.use(piniaPluginPersistedstate)

//引入路由拦截
import './permission'

// 引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
app.use(ElementPlus)

//axios cancel req
window.__axiosPromiseArr = []

//引入router
import router from './router'
app.use(router)

//import global directive
import directive from '@/directives'
directive(app)

//import unocss
import 'uno.css'

import './theme/index.scss'

//import svg-icon
import 'virtual:svg-icons-register'
import SvgIcon from '@/icons/svg-icon.vue'
app.component('SvgIcon', SvgIcon)

app.mount('#app')
